# Copyright 2010-2025 Google LLC
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

load("@protobuf//bazel:cc_proto_library.bzl", "cc_proto_library")
load("@protobuf//bazel:proto_library.bzl", "proto_library")
load("@protobuf//bazel:py_proto_library.bzl", "py_proto_library")
load("@rules_cc//cc:defs.bzl", "cc_library")

package(default_visibility = ["//visibility:public"])

proto_library(
    name = "bop_parameters_proto",
    srcs = ["bop_parameters.proto"],
)

cc_proto_library(
    name = "bop_parameters_cc_proto",
    deps = ["bop_parameters_proto"],
)

cc_library(
    name = "bop_types",
    hdrs = ["bop_types.h"],
    deps = [
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
    ],
)

cc_library(
    name = "bop_base",
    srcs = ["bop_base.cc"],
    hdrs = ["bop_base.h"],
    deps = [
        ":bop_parameters_cc_proto",
        ":bop_solution",
        ":bop_types",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "@abseil-cpp//absl/synchronization",
        "//ortools/glop:lp_solver",
        #        "//ortools/glop",
        "//ortools/lp_data:base",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:clause",
        "//ortools/sat:sat_base",
        "//ortools/sat:sat_solver",
        "//ortools/base:threadpool",
        "//ortools/util:stats",
        "//ortools/util:time_limit",
    ],
)

cc_library(
    name = "bop_util",
    srcs = ["bop_util.cc"],
    hdrs = ["bop_util.h"],
    deps = [
        ":bop_base",
        ":bop_solution",
        "//ortools/base",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:sat_solver",
    ],
)

cc_library(
    name = "bop_solution",
    srcs = ["bop_solution.cc"],
    hdrs = ["bop_solution.h"],
    deps = [
        ":bop_types",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
    ],
)

cc_library(
    name = "bop_fs",
    srcs = ["bop_fs.cc"],
    hdrs = ["bop_fs.h"],
    deps = [
        ":bop_base",
        ":bop_parameters_cc_proto",
        ":bop_solution",
        ":bop_types",
        ":bop_util",
        "//ortools/algorithms:sparse_permutation",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "//ortools/base:stl_util",
        "//ortools/glop:lp_solver",
        #"//ortools/glop",
        "//ortools/lp_data:lp_print_utils",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:lp_utils",
        "//ortools/sat:sat_solver",
        "//ortools/sat:symmetry",
        "//ortools/sat:util",
        "//ortools/util:bitset",
        "//ortools/util:stats",
        "//ortools/util:time_limit",
        "@abseil-cpp//absl/random",
        "@protobuf",
    ],
)

cc_library(
    name = "bop_lns",
    srcs = ["bop_lns.cc"],
    hdrs = ["bop_lns.h"],
    deps = [
        ":bop_base",
        ":bop_parameters_cc_proto",
        ":bop_solution",
        ":bop_types",
        ":bop_util",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "//ortools/base:stl_util",
        "//ortools/glop:lp_solver",
        #"//ortools/glop",
        "//ortools/lp_data:lp_print_utils",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:lp_utils",
        "//ortools/sat:sat_solver",
        "//ortools/util:bitset",
        "//ortools/util:stats",
        "//ortools/util:time_limit",
        "@abseil-cpp//absl/random",
        "@abseil-cpp//absl/cleanup",
        "@protobuf",
    ],
)

cc_library(
    name = "complete_optimizer",
    srcs = ["complete_optimizer.cc"],
    hdrs = ["complete_optimizer.h"],
    deps = [
        ":bop_base",
        ":bop_solution",
        ":bop_types",
        ":bop_util",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:stl_util",
        "//ortools/base:strong_vector",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:encoding",
        "//ortools/sat:optimization",
        "//ortools/sat:sat_solver",
        "//ortools/util:time_limit",
    ],
)

cc_library(
    name = "bop_ls",
    srcs = ["bop_ls.cc"],
    hdrs = ["bop_ls.h"],
    deps = [
        ":bop_base",
        ":bop_solution",
        ":bop_types",
        ":bop_util",
        "//ortools/base",
        "//ortools/base:hash",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:sat_solver",
        "@abseil-cpp//absl/random",
        "@abseil-cpp//absl/status:statusor",
    ],
)

cc_library(
    name = "bop_portfolio",
    srcs = ["bop_portfolio.cc"],
    hdrs = ["bop_portfolio.h"],
    deps = [
        ":bop_base",
        ":bop_fs",
        ":bop_lns",
        ":bop_ls",
        ":bop_parameters_cc_proto",
        ":bop_solution",
        ":bop_types",
        ":bop_util",
        ":complete_optimizer",
        "//ortools/base",
        "//ortools/base:hash",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "@abseil-cpp//absl/log:vlog_is_on",
        "@abseil-cpp//absl/status:statusor",
        "//ortools/base:stl_util",
        "//ortools/glop:lp_solver",
        #"//ortools/glop",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:sat_solver",
        "//ortools/sat:symmetry",
        "//ortools/util:random_engine",
        "//ortools/util:stats",
        "//ortools/util:time_limit",
    ],
)

cc_library(
    name = "bop_solver",
    srcs = ["bop_solver.cc"],
    hdrs = ["bop_solver.h"],
    deps = [
        ":bop_base",
        ":bop_fs",
        ":bop_lns",
        ":bop_ls",
        ":bop_parameters_cc_proto",
        ":bop_portfolio",
        ":bop_solution",
        ":bop_types",
        ":bop_util",
        ":complete_optimizer",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:strong_vector",
        "//ortools/base:stl_util",
        "//ortools/glop:lp_solver",
        #"//ortools/glop",
        "//ortools/lp_data:lp_print_utils",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:boolean_problem_cc_proto",
        "//ortools/sat:lp_utils",
        "//ortools/sat:sat_solver",
        "//ortools/base:threadpool",
        "//ortools/util:bitset",
        "//ortools/util:time_limit",
        "@protobuf",
        "//ortools/util:stats",
    ],
)

cc_library(
    name = "integral_solver",
    srcs = ["integral_solver.cc"],
    hdrs = ["integral_solver.h"],
    deps = [
        ":bop_base",
        ":bop_fs",
        ":bop_lns",
        ":bop_ls",
        ":bop_parameters_cc_proto",
        ":bop_solution",
        ":bop_solver",
        ":bop_types",
        ":bop_util",
        "//ortools/base",
        "//ortools/base:intops",
        "//ortools/base:stl_util",
        "//ortools/base:strong_vector",
        "//ortools/glop:lp_solver",
        "//ortools/lp_data",
        "//ortools/lp_data:lp_decomposer",
        "//ortools/lp_data:lp_utils",
        "//ortools/sat:boolean_problem",
        "//ortools/sat:lp_utils",
        "//ortools/sat:sat_solver",
        "//ortools/util:bitset",
        "//ortools/util:stats",
        "//ortools/util:time_limit",
        "@protobuf",
    ],
)
